<!DOCTYPE html>
<html lang="en">

<head>
  <meta charset="UTF-8">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>

<body>
  <div>
    <div>
      <!-- 源元素  -->
      <img src="https://robohash.org/1231231" alt="" draggable="true">
      <a href="#" draggable="true">11231231</a>
      <span draggable="true">1231231</span>
    </div>

    <div>
      <!-- 目标元素 -->
      <div style="width: 500px;height: 500px;border: 1px solid #ccc;" class="target">

      </div>
    </div>
  </div>
  <script>
    const target = document.querySelector('.target');

    target.addEventListener('drop', () => {
      console.log(123)
    })

    document.addEventListener('dragover', e => {
      e.preventDefault();
    })
  </script>
</body>

</html>